package cn.javaxc.mvcwork.modules.login;
import cn.javaxc.mvcwork.framework.beans.TFormBean;
import cn.javaxc.mvcwork.controller.MVCConfig;
import java.io.File;
public class TemplateBean extends TFormBean
{ 

	private String htmlcss;
	private String htmltheme;
	private String theme;
	private String portalcss="portal";

	public String getHtmlcss(){
		if(htmlcss==null||htmlcss.equals(""))
			htmlcss=MVCConfig.getConfig().get("layout.template");
		return this.htmlcss;
	}
	public void setHtmlcss(String tmp){
		if(tmp==null||tmp.equals(""))return;
		this.htmlcss=tmp;
	}
	public String getHtmltheme(){
		if(htmltheme==null||htmltheme.equals(""))
			htmltheme=MVCConfig.getConfig().get("layout.theme");
		return this.htmltheme;
	}
	public void setHtmltheme(String tmp){
		if(tmp==null||tmp.equals(""))return;
		this.htmltheme=tmp;
	}
	
	public String getTheme(){
		return this.theme;
	}
	public void setTheme(String theme){
		if(theme==null||theme.equals("")||"-1".equals(theme))return;
		this.theme=theme;
		String root=MVCConfig.getConfig().getWebRoot();
		if (root!=null){
			File cssFile=new File(root,"css/"+"css"+theme);
			if (cssFile.exists()){
				setHtmlcss("css"+theme);
			}else{
				setHtmlcss("css1");	
			}
		}else{
			setHtmlcss("css1");
		}
		setHtmltheme("theme/"+theme);
	}
	public String toString(){
		return htmltheme+","+htmlcss+","+portalcss;
	}
	public String getPortalcss(){
		return this.portalcss;
	}
	public void setPortalcss(String portalcss){
		this.portalcss=portalcss;
	}

}
